<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../houtai/include/peizhi.jsp"%>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<link rel="shortcut icon" type="image/x-icon" href="${ctx}/images/favicon.ico" />
	<meta name="title" content="${titleVo.title}">
	<meta name="keywords" content="${titleVo.keyword}">
	<meta name="description" content="${titleVo.content}">
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<link rel="stylesheet" type="text/css" href="${ctx}/css/basepc.css">
	<link rel="stylesheet" type="text/css" href="${ctx}/css/index.css">
	<script type="text/javascript" src="${ctx}/js/jquery-1.9.1.min.js"></script>
	<script type="text/javascript" src="${ctx}/js/jedate/jedate.js"></script>
	<title></title>
</head>
<body>
<form action="${cxt}/list/indexList" id='tolist' method="post">
	<div class="home-top">
		<jsp:include page="/WEB-INF/views/qiantai/include/head.jsp" />
		<div class="home-ui">
			<div class="home-ui-box">
				<div class="home-ui-list">
					<ul>
						<li class="active">展会</li>
						<!-- <li>展馆</li>
						<li>主办方</li> -->
					</ul>
				</div>
				<div class="home-ui-con">
					<div class="home-ui-from">
						<h4>检索</h4>
						<ul>
							<li>
								<p><input type="text" name='keyword'  placeholder="关键字" /></p>
							</li>
							<li>
								<p>
									<select name='codeCode' id='codeCode'>
										<option>行业</option>
									</select>
									<%-- <span><img src="${ctx}/images/front/index/sanjiao.png"/></span> --%>
								</p>
							</li>
							<%-- <li>
								<p>
									<select>
										<option>二级行业</option>
									</select>
									<span><img src="${ctx}/images/front/index/sanjiao.png"/></span>
								</p>
							</li> --%>
							<li class="home-ui-from-short">
								<p>
									<input type="text" name="starttime" id="startDate" value='2017-01-01' onclick="jeDate({dateCell:'#startDate',isTime:true,format:'YYYY-MM-DD'})">
									<%-- <span class="bg"><img src="${ctx}/images/front/index/sanjiao.png"/></span> --%>
								</p>
							</li>
							<li class="home-ui-from-short">
								<p>
									<input type="text" name="endtime" id="endDate" value='2018-12-31' onclick="jeDate({dateCell:'#endDate',isTime:true,format:'YYYY-MM-DD'})">
									<%-- <span class="bg"><img src="${ctx}/images/front/index/sanjiao.png"/></span> --%>
								</p>
							</li>
							<li class="home-ui-from-short">
								<p>
									<select id='cCountry' name='cCountry'>
										<option value=''>国家</option>
									</select>
									<%-- <span class="bg"><img src="${ctx}/images/front/index/sanjiao.png"/></span> --%>
								</p>
							</li>
							<li class="home-ui-from-short">
								<p>
									<select id='cCity' name='cCity'>
										<option value=''>城市</option>
									</select>
									<%-- <span class="bg"><img src="${ctx}/images/front/index/sanjiao.png"/></span> --%>
								</p>
							</li>
							<%-- <li class="home-ui-from-short">
								<p>
									<select name='codeCode' id='codeCode'>
										<option>类型</option>
									</select>
									<span class="bg"><img src="${ctx}/images/front/index/sanjiao.png"/></span>
								</p>
							</li> --%>
						</ul>
					</div>
					<%-- <div class="home-ui-from" style="display: none">
						<h4>检索</h4>
						<ul>
							<li class="home-ui-from-short">
								<p>
									<select>
										<option>国家</option>
									</select>
									<span class="bg"><img src="${ctx}/images/front/index/sanjiao.png"/></span>
								</p>
							</li>
							<li class="home-ui-from-short">
								<p>
									<select>
										<option>城市</option>
									</select>
									<span class="bg"><img src="${ctx}/images/front/index/sanjiao.png"/></span>
								</p>
							</li>
							<li>
								<p>
									<input type="text"  placeholder="展馆名称" />
									<span class="bg"><img src="${ctx}/images/front/index/sanjiao.png"/></span>
								</p>
							</li>
						</ul>
					</div> --%>
					<%-- <div class="home-ui-from" style="display: none">
						<h4>检索</h4>
						<ul>
							<li class="home-ui-from-short">
								<p>
									<select>
										<option>国家</option>
									</select>
									<span class="bg"><img src="${ctx}/images/front/index/sanjiao.png"/></span>
								</p>
							</li>
							<li class="home-ui-from-short">
								<p>
									<select>
										<option>城市</option>
									</select>
									<span class="bg"><img src="${ctx}/images/front/index/sanjiao.png"/></span>
								</p>
							</li>
							<li>
								<p>
									<input type="text"  placeholder="主办方" />
									<span class="bg"><img src="${ctx}/images/front/index/sanjiao.png"/></span>
								</p>
							</li>
						</ul>
					</div> --%>
					<div class="home-ui-search">
						<p><img onclick='toList()' style="cursor:pointer" src="${ctx}/images/front/index/search_btn1.png"/></p>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="w1200">
		<p class="home-mid">
			<img src="${ctx}/images/front/index/banner_two.jpg">
		</p>
	</div>
	<div class="w1200">
		<div class="home-tap">
			<div class="home-tap-l">
				<h4>最新更新</h4>
				<ul>
					<c:forEach var="LContent" items="${newList}" varStatus="status">
						<li>
							<span><a href='/content?id=${LContent.id}'>${fn:stringLengh(LContent.title,5)}</a></span>
							<i><fmt:formatDate pattern="yyyy-MM-dd" value="${LContent.creattime}"/></i>
						</li>
					</c:forEach>
				</ul>
			</div>
			<div class="home-tap-m">
				<h4>最受关注<span class="leftarrow"></span><span class="rightarrow"></span></h4>
				<ul>
					<c:forEach var="LContent" items="${imgList}" varStatus="status">
						<li>
							<a href='/content?id=${LContent.id}'><img src="${ctx}/upload/img/${LContent.headimg}" /></a>
						</li>
					</c:forEach>
				</ul>
			</div>
			<div class="home-tap-r">
				<h4>即将开展</h4>
				<ul>
					<c:forEach var="LContent" items="${newDateList}" varStatus="status">
						<li>
							<span><a href='/content?id=${LContent.id}'>${fn:stringLengh(LContent.title,5)}</a></span>
						</li>
					</c:forEach>
				</ul>
			</div>
		</div>
	</div>
</form>
	<jsp:include page="/WEB-INF/views/qiantai/include/foot.jsp"/>
	<script type="text/javascript">
		$(".home-ui-list ul li").unbind().on("click",function(){
			var index=$(this).index();
			$(this).addClass("active").siblings("li").removeClass("active");
			$(".home-ui-from").eq(index).show().siblings(".home-ui-from").hide();
		});
		$(function(){
			//左右切换效果
			var indold=0; //本次点击的图片序列
			var indnew=0;  //前一次点击的图片序列
			var lileft=$(".home-tap-m").width();
			var leng=$(".home-tap-m ul li").length;
			//向前按钮
			$(".leftarrow").on("click",function(){
				indold--;
				if(indold<0){indold = leng-1;}
				$(".home-tap-m ul li").eq(indold).stop(true,true).css("left",-lileft).animate({left:0},1000);
				$(".home-tap-m ul li").eq(indnew).stop(true,true).animate({left:lileft},1000);
				indnew = indold;
			});
			//向后按钮
			$(".rightarrow").on("click",function(){
				indold++;
				if(indold>=leng){indold = 0;}
				$(".home-tap-m ul li").eq(indold).stop(true,true).css("left",lileft).animate({left:0},1000);
				$(".home-tap-m ul li").eq(indnew).stop(true,true).animate({left:-lileft},1000);
				indnew =indold;
			});
			//自动轮播，鼠标放在切换按钮上停止自动
			function autoPlay(ind){
				indold++;
				if(indold>=leng){indold = 0;}
				$(".home-tap-m ul li").eq(indold).stop(true,true).css("left",lileft).animate({left:0},1000);
				$(".home-tap-m ul li").eq(indnew).stop(true,true).animate({left:-lileft},1000);
				indnew =indold;
			}
			var auto = setInterval(autoPlay,3000);
			$(".home-tap-m ul li,.rightarrow,.leftarrow").hover(function(){
				clearInterval(auto);
			},function(){
				auto = setInterval(autoPlay,3000);
			});
			$.ajax({
				url:"/index/getCode",
				type:"post",
				data:"",
				success:function(data){
					if(data!=null && data.length>0){
						var html = '<option value="">行业</option>';
						for (var i = 0; i < data.length; i++) {
							html = html + '<option value="'+data[i].productCode+'">'+data[i].productName+'</option>';
						}
						$("#codeCode").html(html);
					}
				}
			});
		});
		
	//地区查询
	getRegion(2,0);
	function getRegion(t,s){
		var prem = "type="+t+"&cCountry="+$('#cCountry').val();
			/* alert(prem); */
		$.ajax({
			url:"${ctx}/region/getlist",
			type:"post",
			data:prem,
			success:function(data){
				//var list =eval("("+data+")");  
				var html = '';
				if(s=='0'){
					html ='<option value="">国家</option>';
				}
				if(s=='1'){
					html ='<option value="">城市</option>';
				}
				if(data!=null && data.length>0){
					for (var i = 0; i < data.length; i++) {
						if(s=='0'){
							html = html + '<option value="'+data[i].cCountry+'">'+data[i].cCountry+'</option>';
						}
						if(s=='1'){
							html = html + '<option value="'+data[i].cCity+'">'+data[i].cCity+'</option>';
						}
					}
				}
				if(s=='0'){
					$("#cCountry").html(html);
				}
				if(s=='1'){
					$("#cCity").html(html);
				}
			}
		});
	}
	$('#cCountry').change(function () {//选择洲的时候执行的
		getRegion('3','1');
	});
	function toList(){
		$("#tolist").submit();
	}
	</script>
</body>
</html>